package com.bestcem.xm.member.mq;//package com.bestcem.xm.member.mq;
//
//import com.bestcem.xm.config.RabbitMqConstantConfig;
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.DirectExchange;
//import org.springframework.amqp.core.Queue;
//import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
//import org.springframework.amqp.rabbit.connection.ConnectionFactory;
//import org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * 删除联系人 队列配置
// *
// * @author ympan <yuming.pan@idiaoyan.com>
// * @version v1.0
// * @date 2021/12/22 20:08
// */
//@Configuration
//public class MemberDeletedRabbitConfig {
//    @Autowired
//    private RabbitMqConstantConfig rabbitMqConstantConfig;
//
//    @Bean("memberMemberDeletedQueue")
//    public Queue memberMemberDeletedQueue() {
//        return new Queue(rabbitMqConstantConfig.getAppBpMemberMemberDeletedQueue(), true,
//                false, false);
//    }
//
//    @Bean("memberMemberDeletedExchange")
//    public DirectExchange memberMemberDeletedExchange() {
//        return new DirectExchange(rabbitMqConstantConfig.getAppBpMemberMemberDeletedExchange(), true,
//                false);
//    }
//
//    @Bean("memberMemberDeletedBinding")
//    public Binding memberDeletedBinding() {
//        return BindingBuilder.bind(memberMemberDeletedQueue()).to(memberMemberDeletedExchange())
//                .with(rabbitMqConstantConfig.getAppBpMemberMemberDeletedRoutingKey());
//    }
//
//    @Bean("memberMemberDeletedFactory")
//    public RabbitListenerContainerFactory<?> memberMemberDeletedFactory(ConnectionFactory connectionFactory) {
//        // SimpleRabbitListenerContainerFactory发现消息中有content_type有text就会默认将其转换成string类型的（类型如application/x-msgpack）
//        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
//        factory.setPrefetchCount(2);
//        factory.setConnectionFactory(connectionFactory);
//        return factory;
//    }
//}
//